home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / oper_sys / mach / amiga / scsi9091.lzh / req.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-02-24  |  1.8 KB  |  61 lines

  1. /*
  2.  * req.c - by Markus Wandel - 1990
  3.  * Placed in the public domain 7 Oct 1990
  4.  * Please have the courtesy to give credit if you use this code
  5.  * in any program.
  6.  *
  7.  */
  8. #include <exec/types.h>
  9. #include <intuition/intuition.h>
  10.  
  11. #define BASE_EXT_DECL
  12. #define BASE_PAR_DECL struct IntuitionBase *IntuitionBase,
  13. #define BASE_PAR_DECL0 struct IntuitionBase *IntuitionBase
  14. #include <inline/intuition.h>
  15.  
  16. /*
  17.  * Set SysBase to a local variable, that loads directly from 4 when it
  18.  * has to be reloaded
  19.  */
  20. #define BASE_EXT_DECL
  21. #define BASE_NAME (*(void **)4)
  22. #include <inline/exec.h>
  23.  
  24. int
  25. AutoAutoRequest(char *l1, char *l2, char *l3, char *left, char *right)
  26. {
  27.   struct IntuiText line1, line2, line3, lefttext, righttext;
  28.   struct IntuitionBase *IntuitionBase;
  29.   int result;
  30.  
  31.   if (IntuitionBase = (struct IntuitionBase *)OpenLibrary("intuition.library",0))
  32.     {
  33.       line1.FrontPen = AUTOFRONTPEN;
  34.       line1.BackPen = AUTOBACKPEN;
  35.       line1.DrawMode = AUTODRAWMODE;
  36.       line1.ITextFont = AUTOITEXTFONT;
  37.       line1.NextText = 0;
  38.       CopyMem(&line1,&lefttext,(long)sizeof(line1));
  39.       lefttext.LeftEdge = AUTOLEFTEDGE;
  40.       lefttext.TopEdge = AUTOTOPEDGE;
  41.       CopyMem(&lefttext,&righttext,(long)sizeof(line1));
  42.       line1.LeftEdge = 15;
  43.       CopyMem(&line1,&line2,(long)sizeof(line1));
  44.       CopyMem(&line1,&line3,(long)sizeof(line1));
  45.       line1.NextText = &line2;
  46.       line2.NextText = &line3;
  47.       line1.TopEdge = 5;
  48.       line2.TopEdge = 15;
  49.       line3.TopEdge = 25;
  50.  
  51.       line1.IText = (UBYTE *) l1;
  52.       line2.IText = (UBYTE *) l2;
  53.       line3.IText = (UBYTE *) l3;
  54.       lefttext.IText = (UBYTE *) left;
  55.       righttext.IText = (UBYTE *) right;
  56.       result = AutoRequest(IntuitionBase,0L,&line1,left?&lefttext:0L,&righttext,0L,0L,320L,72L);
  57.       CloseLibrary(IntuitionBase);
  58.       return result;
  59.    }
  60. }
  61.